package com.zhou.imaotai.config;

/**
 * @author lcz
 * @desc 配置扩展器
 * @mail lcz_0130@163.com
 * @date 2024/03/26
 */

public class ConfigExpander {
    /**
     * 获取文件保存目录
     */
    public static String getFileProfile() {

        String osName = System.getProperty("os.name").toLowerCase();
        if (osName.contains("win")) {
            return "D:\\uploadPath";
        }
        if (osName.contains("mac")) {
            return "~/uploadPath";
        }
        if (osName.contains("linux")) {
            return "/data/uploadPath";
        }
        return null;
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath() {
        return getFileProfile() + "/avatar";
    }

}
